# -*- coding: utf-8 -*-
# @Time    : 2022/5/25 11:15
# @Author  : leijiu
# @Email   : 517711635@qq.com
# @File    : goods_type_add_page.py
# @Software: PyCharm
"""
添加商品类型页面
"""
from selenium.webdriver.common.by import By


class GoodsTypeAdd():
    def __init__(self, driver):
        self.driver = driver
        #添加类型定位器
    ele_goodstyename_locator = (By.CSS_SELECTOR,"body > div.main-div > form > table > tbody > tr:nth-child(1) > td:nth-child(2) > input[type=text]")
    ele_goodstyebtn_locator = (By.CSS_SELECTOR, "body > div.main-div > form > table > tbody > tr:nth-child(4) > td > input:nth-child(2)")

        #输入品牌类型
    def typename(self):
        self.driver.find_element(*self.ele_goodstyename_locator).send_keys("将也")
        #点击确定
    def addtypebtn(self):
        self.driver.find_element(*self.ele_goodstyebtn_locator).click()
        #编辑
    def altertype(self):
        self.driver.find_element(*self.ele_goodstyename_locator).clear()
        self.driver.find_element(*self.ele_goodstyename_locator).send_keys("有讯")
        self.driver.find_element(*self.ele_goodstyebtn_locator).click()